var _vec3f = require('core/glm.js').vec3f;
var _vec4f = require('core/glm.js').vec4f;

// ==========================
// Color
// ==========================
function Color() {
    this.mColor = new _vec4f(1, 1, 1, 1);
    this.mAlpha = new _vec4f(1, 1, 1, 1);

    this.mColor.scale(this.alpha, this.mAlpha);
}
Color.prototype.setAlpha = function (alpha) {
    this.mColor.scale(alpha, this.mAlpha);
};
Color.prototype.originalColor = function () {
    return this.mColor;
};
Color.prototype.alphaColor = function () {
    return this.mAlpha;
};

// ==========================
// Point
// ==========================
function Point() {
    this.mStart = new _vec3f();
    this.mDest = new _vec3f();
    this.mDirection = new _vec3f();
}
Point.prototype.setDirection = function (x, y) {
    this.mDirection.set(x, y);
};
Point.prototype.getPosition = function (dis) {
    this.mDirection.scale(dis, this.mDest);
    this.mDest.add(this.mStart);
    return this.mDest;
};
Point.prototype.setPosition = function (x, y) {
    this.mStart.set.apply(this.mStart, arguments);
};

exports.createColor = function () {
    return new Color();
};
exports.createPoint = function () {
    return new Point();
};
